$(document).ready(function() {
    $("input:checkbox, input:radio, input:file").not('[data-no-uniform="true"],#uniform-is-ajax').uniform();
});

function executeTasks() {
    var selectedWrapper = $("#wrapperSelector").val();
    var urlList = $.trim($("#urlList").val()).split("\n");

    $(urlList).each(
	    function(idx, val) {
		if (isNotBlank($.trim(val))) {
		    var uid = Math.floor(Math.random() * 10000000000000001);
		    var li = $("<li id='task" + uid + "'><img src='" + $("#contextPath").val() + "/img/ajax-loaders/ajax-loader-1.gif'><a>"
			    + $.trim(val) + "</a></li>");
		    $("#statusList").append(li);

		    $.get($("#contextPath").val() + "/web/ajax/wrapper-enrich", {
			wrapper : selectedWrapper,
			url : $.trim(val)
		    }, function(data) {
			if (isNotBlank(data)) {
			    alert(data);
			    li.find("img").replaceWith("<span class='icon icon-color icon-close'></span>");
			} else {
			    li.find("img").replaceWith("<span class='icon icon-color icon-check'></span>");
			}
			console.log($.trim(val));
		    }).error(function(data) {
			console.log(data);
			alert("error");
		    });
		}

	    });

    $("#urlList").val("");

}